//============================================================================
// Copyright (C) 2010 Brett R. Jones
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
#include "DtwGame.h"


/*
//! Create a box rigid body and attach scene node
void DtwPhysics::PhysCreateBox(	irr::scene::ISceneNode *	poSceneNode,			// irrlicht scene node to attach box physics to
								const btVector3&			btVec3Position,			// position in world to place node at
								const btVector3&			btVec3InitialVelocity,	// initial velocity of object
								const irr::core::vector3df& v3fScale,				// scale of object 
								btScalar					f32Mass )				// mass of object
{
	//numCreatedObjects++;
	
	scene::ISceneNode *Node = smgr->addCubeSceneNode(1.0f);
	Node->setScale(scale);
	Node->setMaterialFlag(video::EMF_LIGHTING, 0);
	Node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
	Node->setMaterialTexture(0, driver->getTexture("rust0.jpg"));

	

	// Set the initial position of the object
	btTransform Transform;
	Transform.setIdentity();
	Transform.setOrigin( btVec3Position * m_f32PhysWorldScaling );

	btDefaultMotionState *MotionState = new IrrPhysMotionState( poSceneNode );
	MotionState->setWorldTransform(Transform);

	// Create the shape
	btVector3 HalfExtents(v3fScale.X * 0.5f, v3fScale.Y * 0.5f, v3fScale.Z * 0.5f);
	btCollisionShape *Shape = new btBoxShape( HalfExtents * m_f32PhysWorldScaling );

	// Add mass
	btVector3 LocalInertia;
	Shape->calculateLocalInertia( f32Mass, LocalInertia);
	//Shape->setMargin(0.01);

	// Create the rigid body object
	btRigidBody * RigidBody = new btRigidBody(f32Mass, MotionState, Shape, LocalInertia);

	// Store a pointer to the irrlicht node so we can update it later
	RigidBody->setUserPointer((void *)( poSceneNode ));
	RigidBody->setLinearVelocity( btVec3InitialVelocity );

	// Add it to the world
	m_poPhysDynamicsWorld->addRigidBody(RigidBody);
}
*/
